import time

st=time.perf_counter()
fav_nums=[int(x) for x in open('m1_sorted.txt')]
k = 545
while k!=0:
    k=0
    for i in range(len(fav_nums)-1):
        if fav_nums[i] > fav_nums[i+1]:
            fav_nums[i],fav_nums[i+1]=fav_nums[i+1],fav_nums[i]
            k+=1
ft=time.perf_counter()
print('m1_sorted.txt:')
print(ft-st)

stt=time.perf_counter()
fav_numss=[int(x1) for x1 in open('m2_reverse.txt')]
kk = 545
while kk!=0:
    kk=0
    for ii in range(len(fav_numss)-1):
        if fav_numss[ii] > fav_numss[ii+1]:
            fav_numss[ii],fav_numss[ii+1]=fav_numss[ii+1],fav_numss[ii]
            kk+=1
ftt=time.perf_counter()
print('m2_reverse.txt')
print(ftt-stt)

st3=time.perf_counter()
fav_numss=[int(x1) for x1 in open('m3_shuffle.txt')]
kk = 545
while kk!=0:
    kk=0
    for ii in range(len(fav_numss)-1):
        if fav_numss[ii] > fav_numss[ii+1]:
            fav_numss[ii],fav_numss[ii+1]=fav_numss[ii+1],fav_numss[ii]
            kk+=1
ft3=time.perf_counter()
print('m3_shuffle.txt')
print(ft3-st3)
